import java.util.HashMap;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lily
 * Date: 2024-10-29
 * Time: 21:10
 */
public class test_3 {
    static StringBuffer sb;
    static HashMap<String, Integer> hash;
    static int n;

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        sb = new StringBuffer();
        hash = new HashMap<>();
        n = in.nextInt();
        int m = in.nextInt();
        for (int i = 0; i < m; i++) {
            int a = in.nextInt();
            int b = in.nextInt();
            hash.put(a + "" + b, hash.getOrDefault(a + "" + b, 0) + 1);
        }
        for (int i = 1; i <= n; i++) {
            go(i);
            sb.deleteCharAt(sb.length() - 1);
        }
    }


    static void go(int num) {
        sb.append(num);
        if (sb.length() == n) {
            for (int i = 0; i < n; i++) {
                System.out.print(sb.charAt(i)+" ");
            }
            return;
        }
        for (int i = 1; i <= n; i++) {
            boolean a = hash.containsKey(num+""+i);
            if (a){
                hash.put(num+""+i, hash.get(num+""+i) - 1);
                go(i);
                sb.deleteCharAt(sb.length() - 1);
                hash.put(num+""+i, hash.getOrDefault(num+""+i,0) + 1);
            }
        }
    }
}
